<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('咨询列表')"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <input id="id" name="id" th:value="${id}" type="hidden">
    <div class="row">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
    var prefix = ctx + "system/member";

    $(function() {
        var options = {
            url: prefix + "/audit?id=" + $('#id').val(),
            createUrl: prefix + "/add",
            updateUrl: prefix + "/detail/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            sortName: "createTime",
            sortOrder: "desc",
            modalName: "咨询管理",
            columns: [
            {
                field: 'id',
                title: '序号'
            },
            {
                field: 'reviewStatus',
                title: '审核状态',
                sortable: false,
                formatter: function (value, row, index) {
                                        return statusTools(row);
                                 }
            },
            {
                field: 'operTime',
                title: '操作时间',
                sortable: false
            },
            {
                field: 'userName',
                title: '操作人',
                sortable: false
            },
            {
                field: 'opinion',
                title: '审核意见'
            }]
        };
        $.table.init(options);
    });

    /*字典列表-详细*/
    function detail(id) {
        var url = prefix + '/detail/' + id;
        $.modal.openTab("标签数据", url);
    }

    function statusTools(row) {
		    if (row.reviewStatus == 0) {
    			return '待审核';
    		} else if(row.reviewStatus == 1){
    			return '审核通过';
    		}else {
    		    return '审核不通过';
    		}
		}

    function updateStatus(data){
        $.operate.get(prefix + "/status?id=" + data);
    }

    function submitHandler() {
			$.modal.close();
		}
</script>
</body>
</html>